package com.nbsaas.boot.merchant.rest.resource;

import com.nbsaas.boot.merchant.api.apis.MerchantCertificationApi;
import com.nbsaas.boot.merchant.data.entity.MerchantCertification;
import com.nbsaas.boot.merchant.api.domain.request.MerchantCertificationRequest;
import com.nbsaas.boot.merchant.api.domain.response.MerchantCertificationResponse;
import com.nbsaas.boot.merchant.api.domain.simple.MerchantCertificationSimple;
import com.nbsaas.boot.merchant.rest.convert.MerchantCertificationSimpleConvert;
import com.nbsaas.boot.merchant.rest.convert.MerchantCertificationEntityConvert;
import com.nbsaas.boot.merchant.rest.convert.MerchantCertificationResponseConvert;
import com.nbsaas.boot.merchant.data.repository.MerchantCertificationRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   商家认证-业务接口实现
*/
@Transactional
@Service
public class MerchantCertificationResource extends BaseResource<MerchantCertification,MerchantCertificationResponse, MerchantCertificationSimple, MerchantCertificationRequest>  implements MerchantCertificationApi {

    @Resource
    private MerchantCertificationRepository merchantCertificationRepository;

    @Override
    public JpaRepositoryImplementation<MerchantCertification, Serializable> getJpaRepository() {
        return merchantCertificationRepository;
    }

    @Override
    public Function<MerchantCertification, MerchantCertificationSimple> getConvertSimple() {
        return new MerchantCertificationSimpleConvert();
    }

    @Override
    public Function<MerchantCertificationRequest, MerchantCertification> getConvertForm() {
        return new MerchantCertificationEntityConvert();
    }

    @Override
    public Function<MerchantCertification, MerchantCertificationResponse> getConvertResponse() {
        return new MerchantCertificationResponseConvert();
    }




}


